package service

import (
	"context"
	v1 "xiaofei-demo/api/service/v1"
	"xiaofei-demo/app/service/internal/biz"
)

type Service struct {
	uc *biz.GreeterUsecase
	user *biz.UserUsecase
}

func NewGreeterService(uc *biz.GreeterUsecase, user *biz.UserUsecase) *Service {
	return &Service{uc: uc, user:  user}
}

func (s *Service) SayHello(ctx context.Context, req v1.HelloRequest) (v1.HelloResponse, error) {
	g := &biz.Greeter{}
	_ = s.uc.Create(ctx, g)
	name := req.Name
	rep := v1.HelloResponse{
		Msg: "hello," + name,
	}
	return rep, nil
}

